package com.eight.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eight.common.pojo.AclRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 向文豪
 * @program: eight-education-parent
 * @description:
 * @date 2023/5/23 21:05
 */
public interface AclRoleDao extends BaseMapper<AclRole> {




    @Select(value = "select r.* from acl_role r join acl_user_role ur on r.id=ur.role_id where ur.user_id=#{userId}")
    List<AclRole> selectByUserId(String userId);

    @Delete(value = "delete from acl_user_role where user_id=#{userId}")
    void deleteByUserId(String userId);
}
